package com.bgIntlgn.client.entity.manufacture;

import yuhuibear.poat.annotations.relation.View;
import yuhuibear.poat.object.bean.Bean;

@View(name = "qa_view", sqlToCreate = "select view.productionitermid as productionitermid, sum(view.broken) as broken from (select view.productionitermid as productionitermid, view.broken as broken from ("
		+ "(select pi.id as productionitermid, sum(qa.broken) as broken "
		+ "from production_iterms as pi, quality_assurences as qa,  work_recods as wr "
		+ "where pi.id=wr.production_iterm_id and wr.id=qa.work_record_id "
		+ "group by pi.id) union (select pi.id as productionitermid, sum(oqa.broken) as broken "
		+ "from production_iterms as pi, out_quality_assurences as oqa, outter_processings as op "
		+ "where pi.id=op.production_iterm_id and op.id=oqa.outter_processing_id "
		+ "group by pi.id)) as view) as view group by view.productionitermid; ")
public class QAView implements Bean {

	private Long productionitermid;
	private Integer broken;

	public Long getProductionitermid() {
		return productionitermid;
	}

	public void setProductionitermid(Long productionitermid) {
		this.productionitermid = productionitermid;
	}

	public Integer getBroken() {
		return broken;
	}

	public void setBroken(Integer broken) {
		this.broken = broken;
	}
}
